﻿///<reference path="jquery.plugins.js">

function load() {
    var itemId = $.getUrlParam("ID");
    //var context = SP.ClientContext.get_current();
    var context = new SP.ClientContext(_spPageContextInfo.webServerRelativeUrl);   
    var web = context.get_web();
    var list = web.get_lists().getById(_spPageContextInfo.pageListId);
    var item = list.getItemById(itemId);
    context.load(item, "Title");
    context.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}

function onQuerySucceeded() {
    alert('Title: ' + this.oWebsite.get_title());
}

function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}

//ExecuteOrDelayUntilScriptLoaded(load(), "sp.js");

SP.SOD.executeFunc('sp.js', 'SP.ClientContext', load());